<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<style type="text/css">
  .RuleTableClass tr{
	   border:dotted thin #cbcbcb;
	   height:22.8px;
	   border-top:none;
	   border-left:none;
	   border-right:none;
  }
 .RuleTableClass .row-odd td { /* 单行 */
	background-color: #fafafa;
}
.RuleTableClass .row-even td { /* 双行 */
	background-color: #f0f6fc;
}
.RuleTableClass .row-hover td { /* 鼠标经过 */
	background-color: #f0f6fc;
}
.RuleTableClass .row-selected td { /* 选中 */
	background-color: #d2e7f2;
}
</style>
<script type="text/javascript">
//跳转到规则运行统计页面
function ruleMoreTable(){
	var pars="";
	var ruleName=$("#framework_firstpage_ruleName").val();
	var dataDate=$("#framework_firstpage_rule_dataDate").val()
	var periodType=$("#framework_firstpage_rule_periodType").val();
	if(ruleName=='规则名称'){
   	    ruleName="";
    }
	pars+="ruleName="+ruleName+"&dataDate="+dataDate+"&periodType="+periodType;
	var url='${pageContext.request.contextPath}/framework/firstPage/data/rule_more_table.jsp?'+pars;
	    url=encodeURI(encodeURI(url));
	  window.top.$('<div style="overflow-y:hidden"/>').dialog({
			href:url,
			width:1000,
			height:435,
			modal:true,
			title:'规则运行统计页面',
			onClose:function(){
				window.top.$(this).dialog('destroy');
			}
		});
}
</script>
<table width="100%" class="RuleTableClass">
    <tr>
       <th style="width:30%;text-align:left;font-size:13px;color:#398ece;font-weight:600;border-bottom:medium solid #65a8e7 ">&nbsp;规则名称</th>
       <th style="width:20%;text-align:center;font-size:13px;color:#398ece;font-weight:600;border-bottom:medium solid #65a8e7 ">规则分类</th>
       <th style="width:30%;text-align:center;font-size:13px;color:#398ece;font-weight:600;border-bottom:medium solid #65a8e7 ">数据日期</th>
       <th style="width:20%;text-align:left;font-size:13px;color:#398ece;font-weight:600;border-bottom:medium solid #65a8e7 ">告警级别</th>
    </tr>
    <c:choose>
       <c:when test="${!empty listData}">
			 <c:forEach items="${listData}" var="list" varStatus="g" step="1">
			    <c:if test="${g.count<=6}">
			       <tr>
				        <td style="text-align:left">
				           <div style="width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;" title="${list.ruleName}">&nbsp;${list.ruleName}</div>
				        </td>
				        <td style="text-align:center">${list.ruleTypeName}</td>
				        <td style="text-align:center">${list.datadate}</td>
				        <c:if test="${list.warnlevel==0}">
				           <td style="width:20%;text-align:left;">
				               <img src="${pageContext.request.contextPath}/images/firstpage/normal_alarm.png" style="width:17px;height:17px;margin-bottom:2px;"/>
				               <span style="vertical-align:middle;color:#7aba42">正常</span>
				           </td>
				        </c:if>
				         <c:if test="${list.warnlevel==1}">
				           <td style="width:20%;text-align:left;">
				               <img src="${pageContext.request.contextPath}/images/firstpage/general_alarm.png" style="width:17px;height:17px;margin-bottom:2px;"/>
				               <span style="vertical-align:middle;color:#8cbeed">一般告警</span>
				           </td>
				        </c:if>
				         <c:if test="${list.warnlevel==2}">
				           <td style="width:20%;text-align:left;">
				               <img src="${pageContext.request.contextPath}/images/firstpage/major_alarm.png" style="width:17px;height:17px;margin-bottom:2px;"/>
				               <span style="vertical-align:middle;color:#ff9200">重要告警</span>
				           </td>
				        </c:if>
				        <c:if test="${list.warnlevel==3}">
				           <td style="width:20%;text-align:left;">
				               <img src="${pageContext.request.contextPath}/images/firstpage/serious_alarm.png" style="width:17px;height:17px;margin-bottom:2px;"/>
				               <span style="vertical-align:middle;color:#ec0101">严重告警</span>
				           </td>
				        </c:if>
			       </tr>
			    </c:if>
			 </c:forEach>
			  <c:if test="${fn:length(listData)>6}">
			     <tr style="border-bottom:none;">
			        <td colspan="4" style="text-align:right;" valign="middle">  
			           <div style="line-height:22px;margin-right:5px;color:#066fcd;cursor:pointer" onclick="ruleMoreTable()">
			              <img src="${pageContext.request.contextPath}/images/firstpage/search.png" style="width:17px;height:17px;margin-top:3px"/>查看更多
			           </div>
			        </td>
			     </tr>
			  </c:if>
      </c:when>
	  <c:otherwise>
	        <tr style="border-bottom:none">
	           <td style="text-align:center" colspan="4" >
	               <div class="wushuju_search" style="width:100%;height:155px"></div>
	           </td>
	        </tr>
	  </c:otherwise>
   </c:choose>
</table>
